////Copyright 2011 - Jonathan Allen

//using System;
//#if DEBUG
//using System.Diagnostics;
//#endif

//namespace Granite.Xaml.Converters
//{
//	/// <summary>
//	/// Outpus the value to Debug.WriteLine whenever this value is converted or converted back.
//	/// The parameter, if included, will prefix the debug text.
//	/// </summary>
//	/// <remarks></remarks>
//    public class DebugTraceConverter : MarkupValueConverter<DebugTraceConverter>
//	{
//		/// <summary>
//		/// 
//		/// </summary>
//		/// <param name="value"></param>
//		/// <param name="targetType"></param>
//		/// <param name="parameter">prefix for debug statement</param>
//		/// <param name="culture"></param>
//		/// <returns></returns>
//		public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
//		{
//#if DEBUG
//			string prefix = (parameter != null ? parameter + " " : "") + "Convert: ";

//			if (value != null)
//				Debug.WriteLine(prefix + value.ToString());
//			else
//				Debug.WriteLine(prefix + "<NULL>");

//#endif
//			return value;
//		}

//		/// <summary>
//		/// 
//		/// </summary>
//		/// <param name="value"></param>
//		/// <param name="targetType"></param>
//		/// <param name="parameter">prefix for debug statement</param>
//		/// <param name="culture"></param>
//		/// <returns></returns>
//		public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
//		{

//#if DEBUG
//			string prefix = (parameter != null ? parameter + " " : "") + "Convert Back: ";

//			if (value == null)
//				Debug.WriteLine(prefix + value);
//			else
//				Debug.WriteLine(prefix + "<NULL>");
//#endif

//			return value;
//		}

//	}
//}
